[ykj_id].vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <script setup>
  2. import * as echarts from 'echarts'
  3. import request from "~/utils/request";
  4. import {REQUEST} from "~/utils/request";
  5. import {user} from "~/store";
  6. import {useRouter} from "vue-router";
  7. const router = useRouter();
  8. const route = useRoute();
  9. const linkTo = (obj) => {
  10. router.push(obj);
  11. };
  12. let ykj_id = $ref('');
  13. let ykj_name = $ref('');
  14. let sm_id = $ref('');
  15. let subject_id = $ref('')
  16. let school_list = $ref([])
  17. let subject_list = $ref([])
  18. let tableData = $ref([])
  19. let barSubject = $ref([]);
  20. let barPercent = $ref([]);
  21. let barUnusual = $ref(['缺考','学号异常','页码异常','缺考异常','客观题异常','选择题异常','判断题异常','填空题异常']);
  22. let barUnData = $ref([40,70,100,70,70,70,80,90])
  23. let sub_nav = [{
  24. id:'1',
  25. name:'考场进度监控'
  26. },{
  27. id:'2',
  28. name:'异常分类监控'
  29. }]
  30. let cur_sub = $ref({
  31. id:'1',
  32. name:'考场进度监控'
  33. })
  34. function getFilterData() {
  35. let data = {
  36. ykj_id: ykj_id
  37. };
  38. request({
  39. url: "/yzy/ksjh/detail",
  40. data: data,
  41. }).then((res) => {
  42. if (res.code === '1') {
  43. subject_list = res.data.one_info.ykj_kskm_ex;
  44. school_list = res.data.one_info.ykj_lkxx_ex;
  45. }
  46. })
  47. }
  48. function getData() {
  49. let data = {
  50. ykj_id: ykj_id,
  51. sm_id: sm_id,
  52. subject_id: subject_id,
  53. };
  54. request({
  55. url: "/yzy/scan/km",
  56. data: data,
  57. }).then((res) => {
  58. if (res.code === '1') {
  59. ykj_name = res.data.ksjh.ykj_ksrwmc;
  60. tableData = res.data.list;
  61. barSubject = [];
  62. barPercent = [];
  63. tableData.forEach(item =>{
  64. barSubject.push(item.ze_xueke_name);
  65. barPercent.push(item.scan_percent);
  66. })
  67. nextTick(()=>{
  68. initChart();
  69. })
  70. }
  71. })
  72. }
  73. function initChart() {
  74. // 基于准备好的dom,初始化echarts实例
  75. let myChart = echarts.init(document.getElementById('barBox'));
  76. myChart.setOption({
  77. tooltip: {
  78. trigger: 'axis',
  79. axisPointer: {
  80. type: 'shadow'
  81. }
  82. },
  83. grid: {
  84. left: '3%',
  85. right: '4%',
  86. bottom: '3%',
  87. containLabel: true
  88. },
  89. xAxis: [
  90. {
  91. type: 'category',
  92. name: '学校',
  93. data: barSubject,
  94. axisTick: {
  95. alignWithLabel: true
  96. },
  97. }
  98. ],
  99. yAxis: [
  100. {
  101. type: 'value',
  102. name: '扫描进度(%)',
  103. nameTextStyle: {
  104. fontSize: 14
  105. }
  106. }
  107. ],
  108. series: [
  109. {
  110. type: 'bar',
  111. barWidth: '27px',
  112. label: {
  113. show: true,
  114. position: 'top',
  115. color: '#000',
  116. fontSize: 14
  117. },
  118. itemStyle:{
  119. color:'#6897FF',
  120. borderRadius: [16, 16, 0, 0]
  121. },
  122. data: barPercent
  123. }
  124. ]
  125. });
  126. }
  127. function initUnChart() {
  128. // 绘制图表
  129. let myChart_u = echarts.init(document.getElementById('unBox'));
  130. myChart_u.setOption({
  131. tooltip: {
  132. trigger: 'axis',
  133. axisPointer: {
  134. type: 'shadow'
  135. }
  136. },
  137. grid: {
  138. left: '3%',
  139. right: '4%',
  140. bottom: '3%',
  141. containLabel: true
  142. },
  143. xAxis: [
  144. {
  145. type: 'category',
  146. name: '考点',
  147. data: barUnusual,
  148. axisTick: {
  149. alignWithLabel: true
  150. },
  151. }
  152. ],
  153. yAxis: [
  154. {
  155. type: 'value',
  156. name: '人数(%)',
  157. nameTextStyle: {
  158. fontSize: 14
  159. }
  160. }
  161. ],
  162. series: [
  163. {
  164. type: 'bar',
  165. barWidth: '27px',
  166. label: {
  167. show: true,
  168. position: 'top',
  169. color: '#000',
  170. fontSize: 14
  171. },
  172. itemStyle:{
  173. color:'#6897FF',
  174. borderRadius: [16, 16, 0, 0]
  175. },
  176. data: barUnData
  177. }
  178. ]
  179. });
  180. }
  181. function switchSub(item) {
  182. cur_sub = item;
  183. if(item.id === '1') {
  184. nextTick(()=>{
  185. initChart();
  186. })
  187. } else {
  188. nextTick(()=>{
  189. initUnChart();
  190. })
  191. }
  192. }
  193. onMounted(() => {
  194. if (route.params.ykj_id) {
  195. ykj_id = route.params.ykj_id;
  196. getData();
  197. getFilterData();
  198. }
  199. })
  200. </script>
  201. <route lang="json">
  202. {
  203. "meta":{
  204. "title":"扫描批阅进度",
  205. "breadcrumb":true
  206. }
  207. }
  208. </route>
  209. <template>
  210. <NavHeader/>
  211. <bread-crumb/>
  212. <div class="w-1200px m-auto">
  213. <div class="relative -mt-40px flex justify-end">
  214. <button type="button" class="back-btn" @click="linkTo({name:'process'})">返回</button>
  215. </div>
  216. <div class="mt-10px w-full bg-hex-fff py-20px px-15px">
  217. <h3 class="mb-20px text-16px text-center">{{ykj_name}}</h3>
  218. <ul class="tab-nav m-auto">
  219. <li @click="linkTo({name:'process-smpyjd-ykj_id',params:{ykj_id:ykj_id}})">科目扫描进度</li>
  220. <li class="selected">考点扫描进度</li>
  221. <li @click="linkTo({name:'process-pyjd-ykj_id',params:{ykj_id:ykj_id}})">批阅进度</li>
  222. </ul>
  223. <div class="mt-30px flex items-center justify-between">
  224. <div>
  225. <el-select v-model="subject_id" placeholder="全部科目" size="large" @change="getData">
  226. <el-option label="全部" value=""
  227. />
  228. <el-option
  229. v-for="item in subject_list"
  230. :key="item.subject_id"
  231. :label="item.subject_name"
  232. :value="item.subject_id"
  233. />
  234. </el-select>
  235. <el-select class="ml-20px" v-model="sm_id" placeholder="全部学校" size="large" @change="getData">
  236. <el-option label="全部" value=""
  237. />
  238. <el-option
  239. v-for="item in school_list"
  240. :key="item.sm_id"
  241. :label="item.sm_name"
  242. :value="item.sm_id"
  243. />
  244. </el-select>
  245. </div>
  246. <ul class="sub-nav">
  247. <li v-for="item in sub_nav" :class="item.id === cur_sub.id?'selected':''" @click="switchSub(item)">{{item.name}}</li>
  248. </ul>
  249. </div>
  250. <div v-if="cur_sub.id === '1'">
  251. <div id="barBox" style="height: 500px"></div>
  252. <table class="mt-20px data-table" cellpadding="0" cellspacing="0">
  253. <tr>
  254. <th>考点</th>
  255. <th>扫描<br>进度</th>
  256. <th>学生数</th>
  257. <th>扫描数</th>
  258. <th>缺考数</th>
  259. <th>学号<br>异常数</th>
  260. <th>页码<br>异常数</th>
  261. <th>缺考<br>异常数</th>
  262. <th>客观题<br>异常数</th>
  263. <th>选择题<br>异常数</th>
  264. <th>判断题<br>异常数</th>
  265. <th>填空题<br>异常数</th>
  266. <th>操作</th>
  267. </tr>
  268. <tr v-for="item in tableData">
  269. <td>{{item.ze_xueke_name}}</td>
  270. <td>{{item.scan_percent}}</td>
  271. <td>{{item.student_num}}</td>
  272. <td>{{item.scan_num}}</td>
  273. <td>{{item.qks}}</td>
  274. <td>{{item.xhycs}}</td>
  275. <td>{{item.ymycs}}</td>
  276. <td>{{item.qkycs}}</td>
  277. <td>{{item.kgtycs}}</td>
  278. <td>{{item.xztycs}}</td>
  279. <td>{{item.pdtycs}}</td>
  280. <td>{{item.tktycs}}</td>
  281. <td>
  282. <button type="button" class="op-btn">查看详情</button>
  283. </td>
  284. </tr>
  285. </table>
  286. </div>
  287. <div v-else>
  288. <div id="unBox" style="height: 500px"></div>
  289. </div>
  290. </div>
  291. </div>
  292. </template>
  293. <style scoped lang="scss">
  294. $color: #0048e5;
  295. .tab-nav{
  296. width: 457px;
  297. background: #ffffff;
  298. border: 1px solid #dbe7ec;
  299. border-radius: 6px;
  300. display: flex;
  301. align-items: center;
  302. padding: 6px 9px;
  303. li{
  304. width: 140px;
  305. height: 28px;
  306. border-radius: 4px;
  307. font-size: 16px;
  308. color: #666;
  309. text-align: center;
  310. line-height: 28px;
  311. cursor: pointer;
  312. &+li{
  313. margin-left: 10px;
  314. }
  315. &.selected{
  316. background: #e2eaf9;
  317. color: #000;
  318. }
  319. }
  320. }
  321. .data-table {
  322. width: 100%;
  323. table-layout: fixed;
  324. tr:nth-child(even) {
  325. background: #F1F7FF;
  326. }
  327. th {
  328. height: 74px;
  329. background: $color;
  330. font-weight: normal;
  331. text-align: center;
  332. font-size: 16px;
  333. color: #fff;
  334. &:first-child{
  335. border-radius: 6px 0 0 0;
  336. }
  337. &:last-child{
  338. border-radius: 0 6px 0 0;
  339. }
  340. }
  341. td {
  342. padding: 15px 0;
  343. font-size: 16px;
  344. color: #474747;
  345. text-align: center;
  346. }
  347. }
  348. .no-data {
  349. width: 100%;
  350. height: 450px;
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. .no-data-img {
  355. width: 233px;
  356. height: 199px;
  357. background: url("/images/no-data.png") center no-repeat;
  358. }
  359. }
  360. .op-btn {
  361. width: 82px;
  362. height: 30px;
  363. background: #fff;
  364. border: 1px solid #003eee;
  365. border-radius: 2px;
  366. font-size: 14px;
  367. color: #003eee;
  368. text-align: center;
  369. &:disabled{
  370. background: #ccc;
  371. border-color: #ccc;
  372. color: #fff;
  373. pointer-events: none;
  374. }
  375. }
  376. .sub-nav{
  377. width: 280px;
  378. height: 30px;
  379. display: flex;
  380. li{
  381. width: 50%;
  382. background: #ffffff;
  383. font-size: 16px;
  384. color: #000;
  385. border: 1px solid #dbe7ec;
  386. line-height: 28px;
  387. text-align: center;
  388. cursor: pointer;
  389. &.selected{
  390. border-radius: 4px!important;
  391. background:#003eee;
  392. border-color: #003eee;
  393. color: #fff;
  394. }
  395. &:first-child{
  396. border-right: 0;
  397. border-radius: 4px 0 0 4px;
  398. }
  399. &:last-child{
  400. border-left: 0;
  401. border-radius: 0 4px 4px 0;
  402. }
  403. }
  404. }
  405. </style>